$(function(){
	$('#ksrq').datepicker({
		autoclose: true,
		language: 'zh-CN'
	});
	$('#jsrq').datepicker({
		autoclose: true,
		language: 'zh-CN'
	});
	
	//取消
	$('.btn-cancel').click(function(){
		location.href = rootPath + '/manage/batch';
	});
	
	//校验
	$('.data-form').validate({
		submitHandler: function(form){
			$(form).ajaxSubmit({
				type: 'POST',
				url: rootPath + '/manage/batch/edit/exec',
				success: function(result){
					if(result){
						var r = $.parseJSON(result);
						if(r && r.resultCode == '000000'){
							layer.msg('操作成功！');
							//toastr["success"]("操作成功！", "成功提示");
							setTimeout(function () {
								location.href = rootPath + '/manage/batch';
						    }, 1000);
						}
					}else{
						layer.alert('操作失败！',{icon: 5});
					}
				}
			});
		}
	});
});